<template>
	<u-row gutter="16">
		<u-col span="6" v-for="(good,index) in collectList" :key="index">
			<goods-card :good="good"></goods-card>
		</u-col>
	</u-row>

</template>

<script>
	export default {
		data() {
			return {
				collectList: []
			}
		},
		methods: {
			getCollectList() {
				const username = uni.getStorageSync('username');
				uniCloud.callFunction({
					name: "collectList",
					data: {
						username: username
					}
				}).then(res => {
					this.collectList = res.result.data
					console.log(this.collectList);
				})
				//先全部获取再筛选
				/* 		uniCloud.callFunction({
							name: 'listGoods',
							data: {
								username: username
							}
						}).then(res => {
							for (let i in res.result.data) {
								// this.goodsList = res.result.data
								if (res.result.data[i].is_like == true) {
									this.goodsInfo = res.result.data[i]
									this.collectList.push(res.result.data[i])

								}
							}
						}) */
			}
		},
		onLoad() {
			this.getCollectList()
		},
	}
</script>

<style>

</style>
